package 第六章面向对象;

public class OOTest04 {
    public static void main(String[] args) {
        //创建一个丈夫对象
        //创建一个妻子对象
        //通过丈夫找到妻子
        Husband hxm = new Husband();
        Wife yy = new Wife();
        hxm.w = yy;
        yy.h = hxm;
        hxm.name = "黄晓明";
        yy.name = "杨颖";

        //通过hxm找到其wife的name
        System.out.println(hxm.w.name);
    }
}
